<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>初探Laravel5--闫海的个人博客-芒果小叨</title>
<meta name="keywords" content="个人博客,闫海个人博客,Laravel,Laravel5,安装Laravel,com" />
<meta name="description" content="第一课，简单介绍composer和Laravel5的安装。" />
<link href="/Public/Index/css/base.css" rel="stylesheet">
<link href="/Public/Index/css/new.css" rel="stylesheet">
<link rel="stylesheet" href="/Public/Index/css/animate.css">
<link rel="stylesheet" type="text/css" href="/Public/Admin/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css">
<script src="http://siteapp.baidu.com/static/webappservice/uaredirect.js" type="text/javascript"></script><script type="text/javascript">uaredirect("http://yanhai0531.com/mobile.php");</script>
<!--[if lt IE 9]>
<script src="/Public/Index/js/modernizr.js"></script>
<![endif]-->

<script type="text/javascript" src="/Public/Admin/Js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="/Public/Admin/ueditor/third-party/SyntaxHighlighter/shCore.js"></script>
<script type="text/javascript">
  SyntaxHighlighter.all();
</script>
<script type="text/javascript">
  var url = '/index/article';
  $(function(){
    var id = '45';
    $.post(url+'/addClick',{'id':id},function(data){
        $("#pclick").html('点击数：' + data);
    });
  })
</script>
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F5a97c6527b57694be765111b6a23bffc' type='text/javascript'%3E%3C/script%3E"));
</script>
</head>
<body>
<script src="/Public/Index/js/jquery.js"></script>
<div class='header animated bounceInDown'>
    <div class='wrap'>
      <div class='logo'><a data-scroll-reveal='enter from the top over 0.7s' href='/'>
         <img src='/Public/Index/images/logo.png' title='闫海的个人博客首页' alt="logo" /></a>
      </div>
      <div data-scroll-reveal='enter from the top over 0.7s' class='top-nav'>
          <ul id="topnav">
            <li><a href='/'  title='首页'>首页<span></span></a></li>
            <li><a href='/index/list/2.html' title='关于我'>关于我<span> </span></a></li><li><a href='/index/list/3.html' title='时光轴'>时光轴<span> </span></a></li><li><a href='/index/list/1.html' title='品味人生'>品味人生<span> </span></a></li><li><a href='/index/list/5.html' title='技术分享'>技术分享<span> </span></a></li>            <li><a href='/index/article/message.html'  title='给我留言'>给我留言<span></span></a></li>
          </ul>
      </div>
      <div class='clear'></div>
    </div>
</div>
<article class="blogs">
  <h1 class="t_nav">
  	<span>您当前的位置：<a href="/index.html">首页</a>&nbsp;&gt;&nbsp;
	<a href="/index/list/5.html">技术分享</a>
	&nbsp;&gt;&nbsp;<a href="/index/list/17.html">Laravel教程</a>
	
  	</span>  <a href="/index.html" class="n1">网站首页</a>
  </h1>
  <div class="index_about">
    <h2 class="c_titile">初探Laravel5</h2>
    <p class="box_c"><span class="d_time">发布时间：2015-05-28 08:44</span><span>编辑：小叨</span><span id="pclick">点击数：289</span></p>
    <ul class="infos" style="word-break: break-all;">
      <p><span style="font-size: 24px;"><strong>composer</strong></span><br/>安装composer是必须的，mac的话，命令行进入项目目录，执行：<br/></p><pre class="brush:bash;toolbar:false">curl&nbsp;-sS&nbsp;https://getcomposer.org/installer&nbsp;|&nbsp;php</pre><p>下载下来是个打包文件composer.phar<br/>如果你是windows，需要下载&nbsp;<a title="https://getcomposer.org/Composer-Setup.exe" target="_blank" href="https://getcomposer.org/Composer-Setup.exe">https://getcomposer.org/Composer-Setup.exe</a> 来进行管理，值得注意的是，如果安装不成功，一般会提示要开启php扩展openssl，如果你用的wamp集成环境，切记在wamp面板中修改php.ini是没用的，需要修改wamp/bin/php/你的php版本/php.ini，去掉extension=php_openssl.dll前面的分号，并重启server。<br/><strong><span style="font-size: 24px;">安装Laravel</span></strong><br/></p><p>下载<a title="最新版本框架" target="_blank" href="https://github.com/laravel/laravel/archive/master.zip">最新版本框架</a>，解压到项目文件夹下，然后在项目目录下运行：<br/></p><pre class="brush:bash;toolbar:false">php&nbsp;composer.phar&nbsp;install</pre><p>来安装所有的框架依赖包。 但是这样做的话过一会儿你会疯掉，原因很简单，速度慢到死。国内有一个composer的中国镜像，但是不推荐使用，非常不稳定。我使用的是<a title="Composer Proxy JP" target="_blank" href="http://composer-proxy.jp/">http://composer-proxy.jp/</a><br/></p><p>使用方法：<br/>在项目根目录composer.json中加入<br/></p><pre class="brush:js;toolbar:false">&quot;repositories&quot;:&nbsp;[
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&quot;packagist&quot;:&nbsp;false&nbsp;},
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;type&quot;:&nbsp;&quot;composer&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;url&quot;:&nbsp;&quot;http://composer-proxy.jp/proxy/packagist&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;]</pre><p>来提高使用composer下载的速度。配置好后再执行：<br/></p><pre class="brush:bash;toolbar:false">php&nbsp;composer.phar&nbsp;install</pre><p>来安装框架依赖包。<br/>安装完成后运行框架，可以通过apache访问，开启apache，访问项目目录下public，默认显示欢迎界面。。。（可以自行配置apache把public作为根目录）<br/>或者用artisan，命令行中输入：<br/></p><pre class="brush:bash;toolbar:false">php&nbsp;artisan&nbsp;start</pre><p>然后通过localhost：8000访问</p><p>如果一切顺利，你会看到这个界面：</p><p><img alt="psb.jpg" src="/Uploads/ueditor/image/20150528/556663a5b8d4e.jpg" title="556663a5b8d4e.jpg"/></p><p>如果你并没有看到这个界面，而是一片空白，好吧，应该是你目录权限的问题（mac），由于是本地测试，你完全可以在项目返回你项目得上一层目赋予777权限：</p><pre class="brush:bash;toolbar:false">sudo&nbsp;chmod&nbsp;-R&nbsp;0777&nbsp;项目名称</pre><p>OK，开始Laravel5学习之旅吧。</p>    </ul>
    <div class="keybq">
    <p><span>关键字词</span>：Laravel,Laravel5,安装Laravel,com</p>
    
    </div>
    <div class="ad"> </div>
    <div class="nextinfo">
      <p>上一篇：已经是第一篇文章了</p>
      <p>下一篇：<a href="/index/article/46.html">laravel5.1安装</a></p>
    </div>
    <div class="otherlink">
      <h2>相关文章</h2>
      <ul>
        <li><a href="/index/article/48.html" title="【Laravel5教程】mac+apache+mysql配置多站点(一)">【Laravel5教程】mac+apache+mysql配置多站点(一)</a></li><li><a href="/index/article/47.html" title="Laravel5.1配置">Laravel5.1配置</a></li><li><a href="/index/article/46.html" title="laravel5.1安装">laravel5.1安装</a></li><li><a href="/index/article/45.html" title="初探Laravel5">初探Laravel5</a></li>        
      </ul>
    </div>
  </div>
  <aside class="right">
    <div class="news" style="margin-top:10px;">
    <h3>
	<p>最新<span>文章</span></p>
</h3>
	<ul class="rank">
		<li><a href="/index/article/49.html" title="新版网站完成50%了，继续加油吧" >新版网站完成50%了，继续加油吧</a></li><li><a href="/index/article/48.html" title="【Laravel5教程】mac+apache+mysql配置多站点(一)" >【Laravel5教程】mac+apache+mysql配置多站点(一)</a></li><li><a href="/index/article/47.html" title="Laravel5.1配置" >Laravel5.1配置</a></li><li><a href="/index/article/46.html" title="laravel5.1安装" >laravel5.1安装</a></li><li><a href="/index/article/45.html" title="初探Laravel5" >初探Laravel5</a></li><li><a href="/index/article/44.html" title="写了一个PHP框架" >写了一个PHP框架</a></li><li><a href="/index/article/42.html" title="当遇到问题时应该怎样去处理？" >当遇到问题时应该怎样去处理？</a></li><li><a href="/index/article/41.html" title="我的近况和计划" >我的近况和计划</a></li>	</ul>
<h3 class="ph">
    <p>点击<span>排行</span></p>
</h3>
	<ul class="paih">
    	<li><a href="/index/article/31.html" title="关于网站限制ie10以下浏览器访问的探讨" >关于网站限制ie10以下浏览器访问的探讨</a></li><li><a href="/index/article/46.html" title="laravel5.1安装" >laravel5.1安装</a></li><li><a href="/index/article/47.html" title="Laravel5.1配置" >Laravel5.1配置</a></li><li><a href="/index/article/45.html" title="初探Laravel5" >初探Laravel5</a></li><li><a href="/index/article/41.html" title="我的近况和计划" >我的近况和计划</a></li>	</ul>
<h3 class="links">
	<p>友情<span>链接</span></p>
</h3>
	<ul class="website">
		<li><a href="http://www.vso8.com" target="_blank">v8视频</a></li><li><a href="http://www.huanyun.net.cn" target="_blank">焕云企业管理有限公司</a></li><li><a href="http://www.sinkuo.com" target="_blank">济宁网站建设</a></li>	</ul>    </div>  
    <!-- Baidu Button BEGIN -->
    <div id="bdshare" class="bdshare_t bds_tools_32 get-codes-bdshare"><a class="bds_tsina"></a><a class="bds_qzone"></a><a class="bds_tqq"></a><a class="bds_renren"></a><span class="bds_more"></span><a class="shareCount"></a></div>
    <script type="text/javascript" id="bdshare_js" data="type=tools&amp;uid=6574585" ></script> 
    <script type="text/javascript" id="bdshell_js"></script> 
    <script type="text/javascript">

document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000)
</script> 
    <!-- Baidu Button END -->   
    <a onclick="javascript:window.open('/Public/Index/images/weixin.jpg','a', 'height=600,width=600,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');" class="weixin"> </a></aside> 
</article>
<footer>
  <p><a href="http://www.miitbeian.gov.cn/" target="_blank">Copyright © 2015 yanhai All Rights Reversed | 鲁ICP备15004472号-1</a> </p>
</footer>
<script src="/Public/Index/js/silder.js"></script>

<script type="text/javascript">
     if(typeof(Worker) === "undefined"){
     	$.get('/Public/Html5/html5.html', function(data){
			$('body').html(data);
		})
     }
</script>

</body>
</html>